package com.zyh.homework.test06;

import java.util.Scanner;

public class Test6 {
    public static void main(String[] args) {
        System.out.println("请输入一个字符串：");
        String str=new Scanner(System.in).next();
        System.out.println(str);
        char[] chs = str.toCharArray();
        boolean flag=false;
        for (int start=0,end=chs.length-1;start<=end;start++,end--){
            if (chs[start]==chs[end]){
                flag=true;
            }
        }
        if (flag){
            System.out.println("回文数："+flag);
        }
        else {
            System.out.println("回文数："+flag);

        }
    }
}
